﻿using System.Globalization;
using System.Windows.Data;

namespace KxApp.Converters
{
    public class MultiParamConverter : IMultiValueConverter
    {
        public object Convert(
            object[] values,
            Type targetType,
            object parameter,
            CultureInfo culture
        )
        {

            if (values == null || values.Length != 4)
            {
                return false;
            }

            _ = int.TryParse(values[0].ToString(), out int age);
            _ = int.TryParse(values[1].ToString(), out int id);

            _ = int.TryParse(values[2].ToString(), out int age2);
            _ = int.TryParse(values[3].ToString(), out int id2);
            if (age > age2 && id > id2)
            {
                return true;
            }
            return false;
        }

        public object[] ConvertBack(
            object value,
            Type[] targetTypes,
            object parameter,
            CultureInfo culture
        )
        {
            object[] os = [new object()];
            return os;
        }
    }
}
